package com.yl.service.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.yl.domain.VideoUrlDO;
import com.yl.mapper.VideoUrlMapper;
import com.yl.service.VideoUrlService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class VideoUrlServiceImpl implements VideoUrlService {

    @Resource
    VideoUrlMapper videoUrlMapper;


    /**
     * 根据name 获取url地址
     *
     * @param name
     * @author : y
     * @date :  2024/6/24 15:46
     */
    @Override
    public VideoUrlDO getUrlByName(String name) {
        VideoUrlDO videoUrlDO = videoUrlMapper.selectOne(Wrappers.<VideoUrlDO>lambdaQuery().eq(VideoUrlDO::getName, name));
        if (videoUrlDO != null) {
            return videoUrlDO;
        }
        return null;

    }
}
